package com.ifletek.test;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import java.text.SimpleDateFormat;
import java.util.Date;


/**
 * Created by guanxf on 2015/12/28.
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserTestVo {
    private Integer id;
    private String account;
    private String nickname;
    private String password;
    private int sex;
    @Temporal(TemporalType.DATE)
    private Date birthday;
    private String province;
    private String city;
    private int status;
    private String avatar;
    private int type;
    private int isfull;
    private Date createtime;
    private Date updatetime;
    private String  signature;

   public String getCreatetime(){
        if (this.createtime==null) return null;
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//24小时制
        String  dateTime = sdf.format(this.createtime);
        return dateTime;
    }

   public String getBirthday() {
       if (this.birthday == null) return null;
       SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");//24小时制
       String dateTime = sdf.format(this.birthday);
       return dateTime;
   }

}
